<?php echo $this->fetch('member.header.html'); ?>
<script>
$(function(){
	$("#refund_form").submit(function(){
		var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字  
     	if (($('input[name="refund_goods_fee"]').val() !='' && !re.test($('input[name="refund_goods_fee"]').val())) || ($('input[name="refund_shipping_fee"]').val() !='' && !re.test($('input[name="refund_shipping_fee"]').val())))
    	{
        	alert("请输入数字(例:0.02)");
        	return false;
     	}
	 
		if($('input[name="refund_goods_fee"]').val()<0 || $('input[name="refund_goods_fee"]').val()==''){
			alert('退款金额不能为空且必须大于0');
			return false;
		} else if($('input[name="refund_goods_fee"]').val() > <?php echo $this->_var['refund']['goods_fee']; ?>){
			alert('退款金额不能大于商品总额:<?php echo $this->_var['refund']['goods_fee']; ?>');
			return false;
		}
		if($('input[name="refund_shipped"]:checked').val() =='' || $('input[name="refund_shipped"]:checked').val() == undefined){
			alert('请选择收货情况');
			return false;
		}
		if($('input[name="refund_shipping_fee"]').val()<0){
			alert('退运费金额不能小于0');
			return false;
		} else if($('input[name="refund_shipping_fee"]').val() > <?php echo $this->_var['refund']['shipping_fee']; ?>){
			alert('退运费金额不能大于该商品分摊的运费金额:<?php echo $this->_var['refund']['shipping_fee']; ?>');
			return false;
		}
		
		if($('select[name="refund_reason"]').val()==''){
			alert('请选择退款原因');
			return false;
		}
	});	
});
</script>
<style>
.refund_form {width:938px; padding: 20px; overflow: hidden;}
.refund_form ul {width:938px; overflow: hidden;}
.refund_form li {width:938px; overflow: hidden; float: left; padding-bottom: 10px; line-height:30px;}
.refund_form li h3 {float: left; width: 80px; color: #646665; font-weight: normal; font-size: 12px; line-height:30px;}
.refund_form li p {float: left;}
.refund_form li p span {color: #b4b4b4; padding-left: 10px;}
.refund_form .submit {width: 458px;padding: 10px 0 0 80px;}
.refund_form .submit .btn {width: 120px;height: 36px;background-color: #5BB75B;cursor: pointer;font-weight: bold;color: #fff;border: 1px solid #52A452;}
</style>
<div class="content">
    <?php echo $this->fetch('member.menu.html'); ?>
    <div id="right">
        <?php echo $this->fetch('member.curlocal.html'); ?>
        <?php echo $this->fetch('member.submenu.html'); ?>
        <div class="wrap">
            <div class="public refund_form">
                <form id="refund_form" method="post" enctype="multipart/form-data">
                    <ul>
                        <li>
                            <h3>退款金额</h3>
                            <p><input type="text" name="refund_goods_fee" class="text width_short" value="<?php echo $this->_var['refund']['refund_goods_fee']; ?>" style="background:none" /> 元<span class="gray">（最多<?php echo price_format($this->_var['refund']['goods_fee']); ?>元，退款金额=实际购买单价*件数）</span></p>
                        </li>
                        <li>
                            <h3>收货情况</h3>
                            <p>
                                <input type="radio" name="refund_shipped" value="已收到货，需退货退款" id="shipped_2" <?php if ($this->_var['refund']['refund_shipped'] == $this->_var['lang']['shipped_2']): ?> checked="checked"<?php endif; ?> /><label for="shipped_2">已收到货，需退货退款</label>
                                <input type="radio" name="refund_shipped" value="已收到货，不退货只退款" id="shipped_1" class="ml10" <?php if ($this->_var['refund']['refund_shipped'] == $this->_var['lang']['shipped_1']): ?> checked="checked"<?php endif; ?>/><label for="shipped_1">已收到货，不退货只退款</label>
                                <input type="radio" name="refund_shipped" value="未收到货，需要退款" id="shipped_0" class="ml10" <?php if ($this->_var['refund']['refund_shipped'] == $this->_var['lang']['shipped_0'] || ! $this->_var['refund']['refund_shipped']): ?> checked="checked"<?php endif; ?>/><label for="shipped_0">未收到货，需要退款</label>
                            </p>
                        </li>
                        <li>
                            <h3>退&nbsp;&nbsp;运&nbsp;&nbsp;费</h3>
                            <p><input type="text" name="refund_shipping_fee" class="text width_short" value="<?php echo $this->_var['refund']['refund_shipping_fee']; ?>" /> 元<span class="gray">（最多<?php echo $this->_var['refund']['shipping_fee']; ?>元，分摊运费=退款商品/商品总额*总运费。如果不是质量问题，卖家可以拒绝）</span></p>
                        </li>
                        <li>
                            <h3>退款原因</h3>
                            <p>
                                <select class="text" name="refund_reason">
                                    <option value="" selected="selected">请选择退款原因</option>
                                    <option value="缺货" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['out_of_stock']): ?> selected="selected"<?php endif; ?>>缺货</option>
                                    <option value="未按约定时间发货" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['failling_time']): ?> selected="selected"<?php endif; ?>>未按约定时间发货</option>
                                    <option value="收到假货" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['receive_fake']): ?> selected="selected"<?php endif; ?>>收到假货</option>
                                    <option value="商品有质量问题" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['quanlity_isse']): ?> selected="selected"<?php endif; ?>>商品有质量问题</option>
                                    <option value="商品错发/漏发" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['goods_wrong']): ?> selected="selected"<?php endif; ?>>商品错发/漏发</option>
                                    <option value="收到的商品破损" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['goods_damaged']): ?> selected="selected"<?php endif; ?>>收到的商品破损</option>
                                    <option value="收到的商品描述不符" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['goods_not_like']): ?> selected="selected"<?php endif; ?>>收到的商品描述不符</option>
                                    <option value="其他" <?php if ($this->_var['refund']['refund_reason'] == $this->_var['lang']['other']): ?> selected="selected"<?php endif; ?>>其他</option>
                                </select>
                            </p>
                        </li>
                        <li>
                            <h3>退款说明</h3>
                            <p>
                                <textarea name="refund_desc" class="text" cols="80" rows="5" style=" background:none;"><?php echo $this->_var['refund']['refund_desc']; ?></textarea>
                            </p>
                        </li>
                    </ul>
                    <div class="submit">
                        <input class="btn" type="submit" value="<?php if ($_GET['act'] == 'edit'): ?>修改<?php else: ?>提交<?php endif; ?>申请">
                    </div>
                </form>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>
<?php echo $this->fetch('footer.html'); ?>
